package com.ruoyi.house.service.impl;

import java.util.List;

import com.ruoyi.house.dto.HousefbDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.house.mapper.HouseInfoMapper;
import com.ruoyi.house.domain.HouseInfo;
import com.ruoyi.house.service.IHouseInfoService;

/**
 * 房间Service业务层处理
 * 
 * @author hct
 * @date 2022-02-11
 */
@Service
public class HouseInfoServiceImpl implements IHouseInfoService 
{
    @Autowired
    private HouseInfoMapper houseInfoMapper;

    /**
     * 查询房间
     * 
     * @param id 房间主键
     * @return 房间
     */
    @Override
    public HouseInfo selectHouseInfoById(Long id)
    {
        return houseInfoMapper.selectHouseInfoById(id);
    }

    /**
     * 查询房间列表
     * 
     * @param houseInfo 房间
     * @return 房间
     */
    @Override
    public List<HouseInfo> selectHouseInfoList(HouseInfo houseInfo)
    {
        return houseInfoMapper.selectHouseInfoList(houseInfo);
    }

    /**
     * 新增房间
     * 
     * @param houseInfo 房间
     * @return 结果
     */
    @Override
    public int insertHouseInfo(HouseInfo houseInfo)
    {
        return houseInfoMapper.insertHouseInfo(houseInfo);
    }

    /**
     * 修改房间
     * 
     * @param houseInfo 房间
     * @return 结果
     */
    @Override
    public int updateHouseInfo(HouseInfo houseInfo)
    {
        return houseInfoMapper.updateHouseInfo(houseInfo);
    }

    /**
     * 批量删除房间
     * 
     * @param ids 需要删除的房间主键
     * @return 结果
     */
    @Override
    public int deleteHouseInfoByIds(Long[] ids)
    {
        return houseInfoMapper.deleteHouseInfoByIds(ids);
    }

    /**
     * 删除房间信息
     * 
     * @param id 房间主键
     * @return 结果
     */
    @Override
    public int deleteHouseInfoById(Long id)
    {
        return houseInfoMapper.deleteHouseInfoById(id);
    }


    @Override
    public Object getBFHouse(String roomNum, String buildName) throws Exception {
        List<HousefbDTO> bfHouse = houseInfoMapper.getBFHouse(roomNum, buildName);
        return bfHouse;
    }
}
